<?php
 /**
 * 
 * LICENSE: 
 * @author $Id: Urls.php 31 2011-11-22 06:22:25Z kylingood $
 * @since      Release 1.0.0
 * @copyright  Copyright (c) 2010-2011 Mumayi.com Inc. (http://www.mumayi.com)
*/
require_once 'Zend/View/Helper/Abstract.php';

class Custom_View_Helper_Menuacl extends Zend_View_Helper_Abstract
{
	/**
	 * @param unknown_type $menuid  菜单父id
	 * @param unknown_type $roleid  角色id
	 */
    public function menuacl($menuid,$roleid)
    {
    	$result=false;
    	$acl=new Acl();
    	$addwhere="roleid='$roleid'";
    	//先看此角色是否有菜单记录
    	if($acl->fetchRow($addwhere)){
    		$menuArr=$acl->fetchRow($addwhere)->toArray();
    		$menuList=explode(',',$menuArr['menuid']);
    		//是否存在此菜单id
    		if(in_array($menuid, $menuList)){
    			$result=true;
    		}
    	}
        return $result;
          
    }
}